import request from '@/utils/request'

/**
 * 分页配车合同
 * @param {*} form
 * @param {*} pageSize
 * @param {*} currentPage
 */
export function dataList(form, pageSize, currentPage) {
  const data = {
    param: form,
    pageSize: pageSize,
    pageNo: currentPage
  }
  return request.post('/sq/contract/page', data)
}
/**
 * 新增
 * @param {*} options
 */
export function addData(options) {
  return request.post('/sq/contract/save', options)
}
/**
 * 编辑
 * @param {*} options
 */
export function updateData(options) {
  return request.put('/sq/contract/save', options)
}
/**
 * 删除
 * @param {*} id
 */
export function deleteData(id) {
  return request.delete(`/sq/contract/${id}`)
}
/**
 * 根据id查询详情
 * @param {*} options
 */
export function details(id) {
  return request.get('/sq/contract/' + id)
}

// 查询供应商
export function getSupplierByStorId(storeId, partsDictId) {
  return request.get(`/supplier/getSupplier/${storeId}/${partsDictId}`)
}

//查看
export function view() {
  return request.get('/sq/contract/' + id)
}
// 查看车型信息
export function getBaseList(form, pageSize, currentPage, contractNum) {
  const data = {
    param: {...form,contractNum},
    pageSize: pageSize,
    pageNo: currentPage,
   
  }
  return request.post('/sq/contract/carPage', data)
}
// 根据门店获取资金利息
export function findById(id) {
  return request.get('/sq/zjlx/findAllByStoreId/' + id)
}
/**
 * 审核统一
 * @param {*} data
 */
export function auditIsOk(data) {
  return request.post('/sq/audit/auditSp', data)
}
